package com.leyou.trade.utils;

import com.leyou.auth.dto.UserDetail;
import com.leyou.auth.utils.UserContext;

public class CollectionNameBuilder {

    private final String namePrefix;

    public CollectionNameBuilder(String namePrefix) {
        this.namePrefix = namePrefix + "_";
    }
    public String build(){
        UserDetail user = UserContext.getUser();
        if(user==null){
            return "";
        }

        return namePrefix+user.getId().hashCode()%100;
    }
}
